Zoomed Video Driver Calls
As seen in Figure 1, the Zoomed Video driver acts as the interface between the decoder object and the actual Zoomed Video hardware. The decoder object gathers information about the zoomed video hardware by issuing status calls to the driver. It controls the Zoomed Video hardware through the use of control calls. This following sections detail the control and status calls that need to be implemented by a Zoomed Video driver.
General Calling conventions for the Zoomed Video driver
The ZV driver will be called using the MacOS toolbox Control and Status calls. These calls take a pointer to a structure or type, which changes depending on which control or status calls is being issued.
The following lists some hints on implementing the Zoomed Video driver:
- If the driver does not support a particular code, return a
controlErr
orstatusErr
. This is important as clients of the driver rely on getting an error in order to determine whether a certain call is implemented or not.- The first 128 codes are reserved for use by Apple's Zoomed Video Driver API. If you need to implement a special call for use with your own application, use a
cscZVCode
in the range of 128 - 255.- A single file can include multiple native drivers in its data fork. This is achieved by creating a single extended 'cfrg' resource with an ID = 0. The extended cfrag resource should have a libname matching the PC Card's name registry node name, and a libkind of 'ndrv'.
Zoomed Video DriverDescription Header
The following listing shows a sample native driver DriverDescription header. Note that the ZV driver has a 'ndrv' category with a generic type.
Listing 1 Typical Zoomed Video driver description
DriverDescription TheDriverDescription = { kTheDescriptionSignature, // Driver Desrciption Signature kInitialDriverDescriptor, // Driver Description Version // driverType { "f1,ACME", // DeviceName (matches name registry node name) kMajorRev, // Driver version kMinorAndBugRev, kStage, kNonRelRev, }, // driverOSRuntimeInfo { kDriverIsLoadedUponDiscovery | kDriverIsOpenedUponLoad, // Runtime Options kZVDriverName, // Unit Table Driver Name }, // driverSerives 1, // nServices kServiceCategoryNdrvDriver, // Service Category ('ndrv') kNdrvTypeIsGeneric, // Type withing category (generic) 1, 0, finalStage, 0 // Version of the DriverDescription format };